gdk: Ignore crossings generated by passive grabs when resetting scroll axes
authorCarlos Garnacho <carlosg@gnome.org>
Mon, 18 Nov 2013 21:12:18 +0000 (22:12 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Mon, 18 Nov 2013 21:12:18 +0000 (22:12 +0100)
Passive grabs may take pointer focus out of the application, even though
the pointer didn't leave the window, but those events still trigger resetting
of the scroll axes. This is most visible with compiz, and possibly other
reparenting WMs, where passive grabs happen on the WM-managed window that
is a parent of the application toplevel.

As it is not possible to have scrolling happening on the timespan a passive
grab takes action, it is entirely safe for GTK+ to assume none happened if
it gets a crossing event of that nature.

https://bugzilla.gnome.org/show_bug.cgi?id=699574#c33

gdk/x11/gdkdevicemanager-xi2.c

index 7dba5a6eab5f8165f5291fdd3c65ebc43fb7bfeb..87d28100f38ad0d36c8d13922ff26e1645e71c91 100644 (file)
@@ -1585,7 +1585,8 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
                                              GUINT_TO_POINTER (xev->sourceid));
         gdk_event_set_source_device (event, source_device);
 
-        if (ev->evtype == XI_Enter && xev->detail != XINotifyInferior &&
+        if (ev->evtype == XI_Enter &&
+            xev->detail != XINotifyInferior && xev->mode != XINotifyPassiveUngrab &&
            gdk_window_get_window_type (window) == GDK_WINDOW_TOPLEVEL)
           {
             if (gdk_device_get_device_type (source_device) != GDK_DEVICE_TYPE_MASTER)